<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="0" />
<meta name="acc" content="_detect" />
	<script>

$(document).ready(function() {
	
	$("#reportStartdate").addClass("Wate").bind("click", function() {
		WdatePicker({
			skin : 'whyGreen',
			minDate : '1900-10-01',
			maxDate : '%y-%M-%d',
			dateFmt : 'yyyy-MM-dd'
		});
	});
	$("#reportEnddate").addClass("Wate").bind("click", function() {
		WdatePicker({
			skin : 'whyGreen',
			minDate : '1900-10-01',
			dateFmt : 'yyyy-MM-dd'
		});
	});
	});
	
function ExcelProject(id,projectId){
	$.window.prepare({
		   dock: 'left'       // change the dock direction: 'left', 'right', 'top', 'bottom'
		});
	sampleWnd = $.window({
		title: "批次列表选择",
		showFooter: false,
		maximizable:true,
		bookmarkable:false,
		showModal: true,
		resizable:false,
		width: 800,
		height: 550,
		scrollable:true,
		showRoundCorner: true,
		createRandomOffset: {x:0, y:0},
		modalOpacity: 0.5,
		url: appConfig.contPath+"/detect/detect!windows.action?projectId="+projectId+"&id="+id
	});
		sampleWnd.maximize();
}
function ExcelTownship(){
	$.window.prepare({
		   dock: 'left'       // change the dock direction: 'left', 'right', 'top', 'bottom'
		});
	sampleWnd = $.window({
		title: "镇区选择",
		showFooter: false,
		maximizable:true,
		bookmarkable:false,
		showModal: true,
		resizable:false,
		width: 800,
		height: 550,
		scrollable:true,
		showRoundCorner: true,
		createRandomOffset: {x:0, y:0},
		modalOpacity: 0.5,
		url: appConfig.contPath+"/detect/detect!excelTownship.action"
	});
		sampleWnd.maximize();
}

function Project(){
	$.window.prepare({
		   dock: 'left'       // change the dock direction: 'left', 'right', 'top', 'bottom'
		});
	$.window({
		title: "工程列表选择",
		showFooter: false,
		maximizable:true,
		bookmarkable:false,
		showModal: true,
		resizable:false,
		width:700,
		height:400,
		showRoundCorner: true,
		createRandomOffset: {x:-1, y:-1},
		modalOpacity: 0.5,
		minimizable:false,
		url: appConfig.contPath+"/detect/detect!projwin.action"
	});
}
function close(){
	 $.window.closeAll(); 
}

function setPorjectId(projectId){
	window.location.href="${ctx }/detect/detect!input.action?projectId="+projectId;
}
function batch(batch,startTime,endTime){
	openWindowAsDialog('${ctx }/detect/detect!excelOutProj.action?batch='+batch+'&startTime='+startTime+'&endTime='+endTime,{width:50,height:60});
}
function Excel(id,projectId){
	openWindowAsDialog('${ctx}/detect/detect!excel.action?projectId='+projectId+'&filter_EQS_id='+id+'&id='+id,{width:50,height:60});

}

function excelThree(startTime,endTime,type,townItems,roadItems,levelItems){
	openWindowAsDialog('${ctx }/detect/detect!excelThree.action?startTime='+startTime+
					'&endTime='+endTime+'&type='+type+'&townItems='+townItems+'&roadItems='+roadItems+'&levelItems='+levelItems,{width:50,height:60});
}
	</script>
</head>
<body>
<div id="heading" class="detect"><h6>试验检测</h6></div>
<form action="${ctx }/detect/detect.action" method="get" id="mainForm"
	class='yform'>
<div id="filter">
<ul>
	<li>提交时间:<input type="text" id="reportStartdate"
		name="filter_GED_reportdate" value="${param['filter_GED_reportdate']}" />
		——
		<input type="text" id="reportEnddate"
		name="filter_LED_reportdate" value="${param['filter_LED_reportdate']}" />
		</li>
		<li>
		工程名称:
		<input type="text"  value="${param['filter_LIKES_projectInfo.projName']}"
							name="filter_LIKES_projectInfo.projName" >
							</li>
		<li>
		批次:
		<pt:labels type="batch"  default="${param['filter_EQS_batch']}"
							name="filter_EQS_batch" ></pt:labels> 
							</li>
</ul>
<div class="type-button">
<!--<input type="button" onclick="Project();"
	class="button" value="工程选择" />
--><input type="button" onclick="search();"
	class="search" value="查询" /></div>
</div>
<div id="content">
<table>
	<tr>
		<th>工程名称</th>
		<th>抽检总点数</th>
		<th>合格总点数</th>
		<th>合格率（%）</th>
		<th>批次</th>
		<th>检测时间</th>
		<th>操作</th>
		<c:forEach items="${page.result}" var="spotrespot">
			<tr>
				<td>  <pt:text limit="12">${spotrespot.projectInfo.projName}</pt:text> </td>
				<td>${spotrespot.allCount}</td>
				<td>${spotrespot.allPass}</td>
				<td>${spotrespot.allTotalPassrate}</td>
				<td>${spotrespot.batch}</td>
				<td>${spotrespot.reportdate}</td>
				<td>
				<a href="${ctx }/detect/detect!proj.action?projectId=${spotrespot.projectInfo.id}">进入工程</a>&nbsp;
				<a href="javascript:ExcelProject('${spotrespot.id}','${spotrespot.projectInfo.id}');">导出为Excel</a>&nbsp;
				
				</td>
			</tr>
		</c:forEach>
</table>
</div>
<jsp:include page="/common/page.jsp" flush="true" />
<div class="type-button">
<input class="submit" type="button" class="submit" onclick="Project();"
				value="新增" />
			&nbsp; 
<a href="javascript:ExcelTownship()">镇区比较</a>
<!--<input  type="button" class="button" onclick="ExcelProject('','')" value="工程批次" />
--></div>
</form>
</body>
